//
//  HWzhizunhuiView.m
//  HWanGame
//
//  Created by 陈道斌 on 2019/10/31.
//  Copyright © 2019 Chendaobin. All rights reserved.
//

#import "HWzhizunhuiView.h"

@interface HWzhizunhuiView()<UITableViewDataSource,UITableViewDelegate>
@property(strong,nonatomic) UITableView *mainaTableVie;
@property(strong,nonatomic) NSArray *dataArr;
@end

@implementation HWzhizunhuiView

-(UITableView *)mainaTableVie {

    if  (_mainaTableVie == nil) {

        _mainaTableVie = [[UITableView alloc]initWithFrame:CGRectMake(14, 0, kScreenW-14*2, 40+25*6) style:UITableViewStylePlain];
        _mainaTableVie.delegate = self;
        _mainaTableVie.dataSource = self;
        _mainaTableVie.separatorStyle = UITableViewCellSeparatorStyleNone;
        
        _mainaTableVie.backgroundColor = [UIColor whiteColor];
        _mainaTableVie.backgroundColor = RGB(245, 245, 245);
       // _mainaTableVie.backgroundColor = RGB(241, 242, 244);
        
    }
    return   _mainaTableVie ;

}


- (instancetype)initWithFrame:(CGRect)frame {
    
    
    if (self = [super initWithFrame:frame]) {
        
        [self setUPUI];
        
        
    }
    return  self;
}

// 设置UI
- (void)setUPUI {
    
    [self addshuju];
    
    [self addSubview:self.mainaTableVie];
    
    [self addheaderView];
     
    
    
    
}

// 添加数据
- (void)addshuju {
    
    self.dataArr = @[@"1.购买会员立返等额平台币",@"2.平台充值返还积分",@"3.会员靓丽昵称",@"4.酷炫会员头衔标识",@"5.签到及任务获得额外积分奖励",@"6.交易手续费减免2%"];
    
    
}

//
- (void)addheaderView {
    
    UIView *hederview = [[UIView alloc]initWithFrame:CGRectMake(0, 0, kScreenW-14*2, 40)];
    self.mainaTableVie.tableHeaderView = hederview;
    hederview.backgroundColor = [UIColor whiteColor];
    CGFloat  hederW =  kScreenW-14*2;
    
     UILabel   *nameLabel = [[UILabel alloc]initWithFrame:CGRectMake((hederW-88)/2, 0, 88, 40)];
     nameLabel.text  = @"至尊会员特权";
     nameLabel.font = [UIFont systemFontOfSize:14];
     nameLabel.textColor = RGB(51, 51, 51);
    // nameLabel.backgroundColor = [UIColor redColor];
     [hederview addSubview:nameLabel];
      
     UIImageView *imageView1 = [[UIImageView alloc]initWithFrame:CGRectMake((hederW-88)/2-10-22, 16, 22, 7)];
    imageView1.image = [UIImage imageNamed:@"fl_left_ member"];
    [hederview addSubview:imageView1];
    
    
    
     
    UIImageView *imageView2 = [[UIImageView alloc]initWithFrame:CGRectMake((hederW-88)/2+88+10, 16, 22, 7)];
    imageView2.image = [UIImage imageNamed:@"fl_reght_ member"];
    [hederview addSubview:imageView2];
    
    
   
    
}







- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    
    
    return  self.dataArr.count;
    
    
}



- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    static NSString *cellID = @"cellID";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (!cell) {

        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];

    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    cell.textLabel.text = self.dataArr[indexPath.row];
    cell.textLabel.textColor = RGB(51, 51, 51);
    cell.textLabel.font = [UIFont systemFontOfSize:12];
    cell.backgroundColor = RGB(245, 245, 245);
    
  
    return  cell;
    
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {

    return  25;

}
@end
